/*
 *   This file is part of <open-parametrics>
 *   Copyright (c) 2006-2008 Miguel-Angel Sicilia
 *
 *   open-parametrics is free software: you can redistribute it and/or modify
 *   it under the terms of the Lesser GNU General Public License as
 *   published by the Free Software Foundation, either version 3 of
 *   the License, or (at your option) any later version.
 *
 *   open-parametrics is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with open-parametrics.  If not, see <http://www.gnu.org/licenses/>.
 */
package es.uah.cc.ie.parametrics.regress;

import flanagan.analysis.RegressionFunction;

/**
 * @author Miguel-Angel Sicilia
 *
 */
public class ExponentialFunction implements RegressionFunction{
    /*
	 * Implements the common effort = a*driver^b estimating function,
     * where driver is a cost driver as size.
     *
     * @pre x[0]>0
	 */

	public double function(double[] p, double[] x) {
		assert(x[0]>0);
        double y= p[0]*Math.pow(x[0], p[1]);
		return y;
	}

}
